%if "cls" in locals():
	%classes = cls
%else:
	%classes = ""
%end
<ul class="nav dropdown-menu {{classes}}">
	%maxcols = 1
	%if items:
		%maxcols = max([len(item.text) for item in items])
	%if goback:
		<li><a href="#" tabindex="0" onclick="goBack()"><table><tr><td>←</td></tr></table></a></li>
	%end
	%for i, item in enumerate(items):
		%action = item.action
		%onclick = action
		%highlight = "highlight" if item.highlight else ""
		<li><a class="{{highlight}}" href="#" tabindex="{{i+1}}" onclick="{{onclick}}">
			%width = [100 // maxcols for _ in item.text]
			%if len(item.text) < maxcols:
				%width[0] *= maxcols - len(item.text) + 1
			%end
			<table><tr>
			%for j, text in enumerate(item.text):
				<td style="width: {{width[j]}}%;">{{text}}</td>
			%end
			</tr></table>
		</a></li>
	%end
</ul>

